package cn.lzx.transaction;

import cn.lzx.Bootstrap;
import cn.lzx.log.annotation.ExcludeLog;
import cn.lzx.log.annotation.OpLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.stereotype.Component;

/**
 * Created by lizhenxing on 2017/9/1.
 */
@Component
@OpLog
@Slf4j
public class LogBusinessOpLog {


    public void testExceptionPublic(String username) throws Exception {
        throw new Exception("哈哈，我出错啦");
    }


    @ExcludeLog
    public String testExclude(String name){
        System.out.println(name);
        return "测试 exclude log";
    }

    public static void main(String[] args) throws Exception {
        ConfigurableApplicationContext context = Bootstrap.start();
        LogBusinessOpLog opLog = context.getBean(LogBusinessOpLog.class);
        opLog.testExceptionPublic("l");

    }
}
